package com.itheima.springbootcondition;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringBootConditionApplication {

    public static void main(String[] args) {
        //启动spring的应用返回spring的容器
        ConfigurableApplicationContext context = SpringApplication.run(SpringBootConditionApplication.class, args);

//        //获取到redisTemplate的bean对象（需要进行坐标的导入）
//        Object redisTemplate = context.getBean("redisTemplate");
//        System.out.println(redisTemplate);

        //将配置类中的方法名变成bean对应的名称，返回参数是为bean所对应的值
        Object user = context.getBean("getUser2");
        System.out.println(user);
    }
}
